#include <iostream>
#include <vector>
using namespace std;

class Solution {
public:
    int jump(vector<int>& nums) {
        int n = nums.size();
        int top=0;
        int step[10000]={0};
        for(int i=0;i<n&&top<n;i++) {
            if(top<i+nums[i]) {
                for(int j=top+1;j<=min(i+nums[i], n-1);j++) {
                    step[j]=step[i]+1;
                }
                top=i+nums[i];
            }
        }
        return step[n-1];
    }
};

int main() {
    Solution s;
    int n;
    cin >> n;
    vector<int> nums(n);
    for (int i = 0; i < n; i++) {    
        cin >> nums[i];
    }
    cout<<s.jump(nums)<<endl;
    return 0;
}